package com.sn.springboot_netty.controller;

import com.sn.springboot_netty.utils.FileDownloadUtil;
import com.sn.springboot_netty.utils.ImageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Api(value = "首页",description = "首页调用")
@Controller
public class IndexController extends BaseController{

    @GetMapping("/")
    @ApiOperation(value = "初始界面",notes = "初始界面")
    public String index(){
        return "login";
    }

    @GetMapping("/api")
    @ApiOperation(value = "接口文档",notes = "接口文档")
    public void api(HttpServletResponse response)throws IOException {
        response.sendRedirect("swagger-ui.html");
    }

    @GetMapping("/fileDown")
    @ApiOperation(value = "接口文档",notes = "接口文档")
    public void fileDown(HttpServletResponse response)throws IOException {
        String url = "http://39.101.190.227:8090/img/visu/alarm/8068644C_20200528141709_res.jpg";
//        ImageUtil.makeImage(url);
    }


}
